<template>
  <div class='container'>
    <el-row class="oneTimu">
      <el-col>
        <h2>{{list.title}}</h2>
      </el-col>
      <el-col>
        <span>{{list.createTime | parseTimeByString}}</span>
        <span v-if="list.creatorID == 2">超级管理员</span>
        <span v-if="list.creatorID == 1">录入管理员</span>
        <span class="el-icon-view"></span>
        <span>{{list.visits}}</span>
      </el-col>
      <el-col v-html="list.articleBody" class="wenZhang"></el-col>
    </el-row>
  </div>
</template>

<script>
import { detail } from '@/api/hmmm/articles.js'

export default {
  props: {
    receive: {
      required: true
    }
  },
  data () {
    return {
      list: []
    }
  },
  created () {
    this.getYuLanList()
  },
  methods: {
    async getYuLanList () {
      const { data } = await detail(this.receive)
      this.list = data
      console.log(this.list)
    }
  }
}
</script>

<style scoped lang='less'>
.container{
  span{
    margin: 5px;
    padding-left: 15px;
  }
}
h2{
  width: 760px;
  height: 24px;
  margin: 0;
  margin-bottom: 10px;
  padding-left: 15px;
}
.wenZhang{
  margin-top: 10px;
  border-top: 1px dashed #ccc;
  background-color: #f5f5f5;
  padding-left: 15px;
}
</style>
